package com.bcq.example.provider;


import com.bcq.bcqrpc.RpcApplication;
import com.bcq.bcqrpc.registry.LocalRegistry;
import com.bcq.bcqrpc.server.HttpServer;
import com.bcq.bcqrpc.server.VertxHttpServer;
import com.bcq.example.common.service.UserService;

/**
 * 简易服务提供者示例
 */
public class EasyProviderExample {

    public static void main(String[] args) {
        //注册服务
        //class com.bcq.example.provider.UserServiceImpl: UserServiceImpl.class
        //com.bcq.example.common.service.UserService: UserServiceImpl.class.getName()
        //LocalRegistry.register(UserService.class.getName(), UserServiceImpl.class);
        //启动web服务
        //HttpServer httpServer = new VertxHttpServer();
        //httpServer.doStart(8080);

        // RPC 框架初始化
        RpcApplication.init();

        // 注册服务
        LocalRegistry.register(UserService.class.getName(), UserServiceImpl.class);

        // 启动 web 服务
        HttpServer httpServer = new VertxHttpServer();
        httpServer.doStart(RpcApplication.getRpcConfig().getServerPort());
    }
}
